﻿using System;
using PPClasses;

namespace PortalPlan_IP
{
    internal class Program
    {
        private static int Main(string[] args)
        {
            Console.WriteLine("IP Solver Process");

            if (args.Length != 2)
            {
                Console.WriteLine("Incorrect number of arguments");
                return 1;
            }

            Console.WriteLine("Load problem from " + args[0]);
            Problem problem = Problem.LoadFrom(args[0]);

            Console.WriteLine("Create solver");
            IntegerProgramming ip = new IntegerProgramming(problem.ThePoints);

            Console.WriteLine("Solving...");
            ip.GoGoGo();

            Console.WriteLine(ip.StatusText());

            Console.WriteLine("Saving solution to " + args[1]);
            ip.SavePairsTo(args[1]);

            Console.WriteLine("Done.");
            
            return 0;
        }
    }
}
